home *** CD-ROM | disk | FTP | other *** search
- /*
- ** -----------------------------------------------
- ** $VER: MUIPictureCatalog V4.05 (26 May 2001)
- ** ©1996-2001 Michael Merkel
- ** -----------------------------------------------
- */
-
- SIGNAL ON SYNTAX
- SIGNAL ON HALT
- SIGNAL ON BREAK_C
- OPTIONS RESULTS
-
- /*
- TRACE ALL
- */
-
- /*
- ** first of all add the needed libraries
- */
-
- IF ~show("L","rmh.library")
- THEN IF ~AddLib("rmh.library", 0, -30) THEN EXIT
-
- IF ~show("L","rxasl.library")
- THEN IF ~AddLib("rxasl.library", 0, -30) THEN EXIT
-
- IF ~show("L","rxmui.library")
- THEN IF ~AddLib("rxmui.library", 0, -30) THEN EXIT
-
- /*
- ** DEBUG MODE!!!
- */
-
- Call rxMuiOpt("DEBUGMODE SHOWERR")
-
- /*
- ** Make sure rexx support is opened
- */
- IF ~SHOW('L','rexxsupport.library')
- THEN CALL ADDLIB('rexxsupport.library',0,-30)
- IF ~SHOW('L','softlogik:libs/slarexxsupport.library')
- THEN CALL ADDLIB('softlogik:libs/slarexxsupport.library',0,-30)
-
- IF ~SHOW('P','PAGESTREAM')
- THEN DO
- CALL ShowRequester("Start PageStream first!", "Of course...")
- Exit
- END
- ADDRESS 'PAGESTREAM'
-
- pgsInstallDir = 'PageStream:Scripts/MUIPictureCatalog'
- pgsName = 'MUIPictureCatalog'
- pgsVersion = 'V4.05'
- pgsAuthor = 'Michael Merkel'
- pgsCopy = '©1996-2001 Michael Merkel'
- pgsLVer = '4.00'
- pgsDate = '05/26/2001'
- pgsPic = pgsInstallDir || '/MUIPictureCatalog.pic'
- standardPrefs = pgsInstallDir || '/MUIPictureCatalog.prefs'
-
- TRUE = 1
- FALSE = 0
-
- /*
- ** default settings
- */
- Call SetDefaultPrefs
-
- /*
- ** do some checks before
- */
- Call CheckRoutines
-
- /*
- ** load prefs
- */
- Call LoadPrefs(standardPrefs)
- Call BuildGUI
- muiBusyWinOpen = FALSE
-
- /*
- ** open the window
- */
- 'LOCKINTERFACE TRUE'
- Call Set("muiWin", "OPEN", 1)
- Call GetAttr("muiWin", "OPEN", "o")
- IF (o = 0)
- THEN DO
- Say "can't open window"
- EXIT
- END
-
- Call Set("muiWin", "SLEEP", 1)
- Call PrefsWindowSet()
- Call Set("muiWin", "SLEEP", 0)
- Call EventLoop()
- Call PrefsWindowGet()
- Call Set("muiWin", "OPEN", 0)
- Call BusyOpen("doing pictures...", 2, "...\n...", "...\n...", "", 100, 100, 0)
- Call PictureCatalog()
- Call CleanUp()
-
- EXIT
-
- /* /// AddPicture(name)
- */
- AddPicture:
- PARSE ARG name
-
- DO WHILE (PlaceGraphic(name) > 0)
- IF (lastpic = 1)
- THEN DO /* last picture placed on page */
- Call BusyText(2, "%c%brefreshing display%n\n%c...%n")
- Call BusyProgress(2, 100)
-
- 'REFRESH CONTINUE'
- /*
- 'REFRESHWINDOW WINDOW "'oldwinname'"'
- */
- IF (prefs.PV_action = 1) THEN CALL PrintPage
- ELSE DO
- IF (prefs.PV_action = 2) THEN CALL SaveDocument
- 'CURRENTWINDOWPATH'
- oldwinname = RESULT
- END
- pageNumber = pageNumber + 1
- 'DISPLAY PAGE 'pageNumber' WINDOW "'oldwinname'"'
- nppp = 0
- 'REFRESH WAIT'
- END
- END
- pNum = pNum + 1
- RETURN
- /* /// */
- /* /// BuildGUI()
- */
- BuildGUI:
-
- /*
- ** Create the rxMUI GUI
- ** --------------------
- */
-
- /*
- ** first of all the let's define the application object
- */
-
- muiApp.Title = pgsName
- muiApp.Version = "$VER: "|| pgsVersion ||' ('|| pgsDate ||')'
- muiApp.Copyright = pgsCopy
- muiApp.Author = pgsAuthor
- muiApp.Description = "Create picture catalogs within PageStream"
- muiApp.Base = pgsName
- muiApp.diskobject = pgsName
- muiApp.ctrlc = 1
- muiApp.menustrip = "muiMenuStrip"
- muiApp.subwindow = "muiWin"
-
- /*
- ** let's define the window
- */
- muiWin.ID = "MAIN"
- muiWin.Title = pgsName pgsVersion ||' ('|| pgsDate ||') - '|| pgsCopy
- muiWin.Contents = "muiMainGroup"
-
-
- /*
- ** define the menu
- */
- muiMenuStrip.0 = "muiMenuProject"
- muiMenuProject.Title = "Project"
- muiMenuProject.Class = "MENU"
- muiMenuProject.0 = MenuItem("muiMenuAbout", "About...", "?")
- muiMenuProject.1 = MenuItem("muiMenuAboutrxMUI","About RxMUI..." )
- muiMenuProject.2 = MenuItem("muiMenuAboutMUI", "About MUI..." )
- muiMenuProject.3 = MenuItem("", "BAR" )
- muiMenuProject.4 = MenuItem("muiMenuQuit", "Quit", "Q")
- muiMenuStrip.1 = "muiMenuPrefs"
- muiMenuPrefs.Title = "Prefs"
- muiMenuPrefs.Class = "MENU"
- muiMenuPrefs.0 = MenuItem("muiMenuPrefsMUI", "MUI...", "M")
- muiMenuPrefs.1 = MenuItem("", "BAR")
- muiMenuPrefs.2 = MenuItem("muiMenuLoad", "Load", "L")
- muiMenuPrefs.3 = MenuItem("muiMenuSave", "Save", "S")
- muiMenuPrefs.4 = MenuItem("muiMenuSaveAs", "Save As...", "A")
- res = NewObj("MENUSTRIP", "muiMenuStrip")
- IF (res ~= 0)
- THEN Call Err(res)
-
- /*
- ** let's define the window contents
- */
-
- tab = 0
-
- muiMainGroup.0 = "muiGroup0"
- muiGroup0.Class = "GROUP"
- muiGroup0.Frame = "GROUP"
- muiGroup0.Horiz = 0
- muiGroup0.0 = "muiGroup00"
- muiGroup00.Class = "GROUP"
- muiGroup00.Horiz = 1
- muiGroup00.Frame = "GROUP"
- muiGroup00.Background = "FILLBACK"
- muiGroup00.0 = HSpace()
- muiGroup00.1 = "muiBITMAP"
- muiBITMAP.Class = "BITMAP"
- muiBITMAP.Precision = "ICON"
- muiBITMAP.File = pgsPic
- muiBITMAP.InputMode = "RelVerify"
- muiBITMAP.Frame = "BUTTON"
- muiGroup00.2 = Label(ParseText('%c%b%8'|| pgsName pgsVersion ||'%n\n'|| pgsCopy))
- muiGroup00.3 = HSpace()
- muiGroup0.1 = "muiGroupPage00"
- muiGroupPage00.Class = "GROUP"
- muiGroupPage00.Horiz = 1
- muiGroupPage00.0 = "muiPagerList"
- muiPagerList.Class = "NLISTVIEW"
- muiPagerList.List = "pagerList"
- muiPagerList.Weight = 20
- pagerList.Class = "NLIST"
- pagerList.List = "pagerList"
- pagerList.0 = "Page"
- pagerList.1 = "Thumbnails"
- pagerList.2 = "File settings"
- pagerList.3 = "Printer settings"
- pagerList.4 = "Types"
- muiGroupPage00.1 = MakeObj(,"Balance",)
- muiGroupPage00.2 = "muiPager"
- muiPager.Class = "GROUP"
- muiPager.Weight = 50
- muiPager.PageMode = 1
- /*---------------------------------------------*/
- muiPager.tab = "muiTabPage"; tab = tab + 1
- muiTabPage.Class = "GROUP"
- muiTabPage.0 = VSpace()
- muiTabPage.1 = "muiTabPage0"
- muiTabPage0.Class = "GROUP"
- muiTabPage0.Frame = "GROUP"
- muiTabPage0.FrameTitle = "PictureCatalog sizes"
- muiTabPage0.Background = "BACKGROUND"
- muiTabPage0.Horiz = 1
- muiTabPage0.0 = "muiTabPage00"
- muiTabPage00.Class = "GROUP"
- muiTabPage00.Columns = 4
- muiTabPage00.0 = Label("Top")
- muiTabPage00.1 = String("g_top")
- muiTabPage00.2 = Label("Left")
- muiTabPage00.3 = String("g_left")
- muiTabPage00.4 = Label("Bottom")
- muiTabPage00.5 = String("g_bottom")
- muiTabPage00.6 = Label("Right")
- muiTabPage00.7 = String("g_right")
- muiTabPage0.1 = Button("g_grabMP", "grab MP")
- muiTabPage.2 = VSpace(10)
- muiTabPage.3 = "muiTabPage1"
- muiTabPage1.Class = "GROUP"
- muiTabPage1.Frame = "GROUP"
- muiTabPage1.FrameTitle = "Page"
- muiTabPage1.Background = "BACKGROUND"
- muiTabPage1.Horiz = 1
- muiTabPage1.0 = Label("page border width")
- muiTabPage1.1 = String("g_pbw")
- muiTabPage1.2 = Label("text size")
- muiTabPage1.3 = String("g_lsize")
- muiTabPage.4 = VSpace()
- /*---------------------------------------------*/
- muiPager.tab = "muiTabThumb"; tab = tab + 1
- muiTabThumb.Class = "GROUP"
- muiTabThumb.0 = "muiTabThumb0"
- muiTabThumb0.Class = "GROUP"
- muiTabThumb0.Frame = "GROUP"
- muiTabThumb0.FrameTitle = "Thumbnail sizes"
- muiTabThumb0.Background = "BACKGROUND"
- muiTabThumb0.0 = "G_SIZE"
- g_size.Class = "CYCLE"
- g_size.Entries = "variable size|fixed size"
- g_size.Selected = 0
- muiTabThumb0.1 = "muiTabThumb00"
- muiTabThumb00.Class = "GROUP"
- muiTabThumb00.Horiz = 1
- muiTabThumb00.0 = "muiTabThumb000"
- muiTabThumb000.Class = "GROUP"
- muiTabThumb000.0 = "muiTab0000T"
- muiTab0000T.Class = "TEXT"
- muiTab0000T.Contents = ParseText('%c%8number of pictures per page%n')
- muiTabThumb000.1 = "muiTab00000"
- muiTab00000.Class = "GROUP"
- muiTab00000.Columns = 2
- muiTab00000.0 = Label(ParseText('#x:'))
- muiTab00000.1 = "G_X_NUM"
- g_x_num.Class = "SLIDER"
- g_x_num.Min = 1
- g_x_num.Max = 40
- g_x_num.Level = 1
- muiTab00000.2 = Label(ParseText('#y:'))
- muiTab00000.3 = "G_Y_NUM"
- g_y_num.Class = "SLIDER"
- g_y_num.Min = 1
- g_y_num.Max = 40
- g_y_num.Level = 1
- muiTabThumb00.1 = "muiTabThumb001"
- muiTabThumb001.Class = "GROUP"
- muiTabThumb001.Disabled = 1
- muiTabThumb001.0 = "muiTabThumb001T"
- muiTabThumb001T.Class = "TEXT"
- muiTabThumb001T.Contents = ParseText('%c%8fixed size of one picture%n')
- muiTabThumb001.1 = "muiTabThumb0010"
- muiTabThumb0010.Class = "GROUP"
- muiTabThumb0010.Columns = 2
- muiTabThumb0010.0 = Label(ParseText('x size:'))
- muiTabThumb0010.1 = String("g_x_size")
- muiTabThumb0010.2 = Label(ParseText('y size:'))
- muiTabThumb0010.3 = String("g_y_size")
- muiTabThumb0.2 = "muiTabThumb01"
- muiTabThumb01.Class = "GROUP"
- muiTabThumb01.Horiz = 1
- muiTabThumb01.0 = Checkmark(g_upscale)
- muiTabThumb01.1 = Label(ParseText('do not upscale'))
- muiTabThumb01.2 = HSpace()
- muiTabThumb0.3 = "muiTabThumb02"
- muiTabThumb02.Class = "GROUP"
- muiTabThumb02.Horiz = 1
- muiTabThumb02.0 = Checkmark(g_vertical)
- muiTabThumb02.1 = Label(ParseText('vertical mode'))
- muiTabThumb02.2 = HSpace()
- muiTabThumb0.4 = "muiTabThumb03"
- muiTabThumb03.Class = "GROUP"
- muiTabThumb03.Horiz = 1
- muiTabThumb03.0 = Label(ParseText('fpo for thumbnails'))
- muiTabThumb03.1 = "G_FPO"
- g_fpo.Class = "CYCLE"
- g_fpo.Entries = const.fpo.0 ||'|'|| const.fpo.1 ||'|'|| const.fpo.2 ||'|'|| const.fpo.3 ||'|'|| const.fpo.4
- g_fpo.Selected = 0
- muiTabThumb0.5 = "muiTabThumb04"
- muiTabThumb04.Class = "GROUP"
- muiTabThumb04.Columns = 2
- muiTabThumb04.0 = Label("custom FPO (dpi)")
- muiTabThumb04.1 = String("g_fpoCustom")
- muiTabThumb.1 = VSpace(10)
- muiTabThumb.2 = "muiTabThumb3"
- muiTabThumb3.Class = "GROUP"
- muiTabThumb3.Frame = "GROUP"
- muiTabThumb3.FrameTitle = "Thumbnail"
- muiTabThumb3.Background = "BACKGROUND"
- muiTabThumb3.0 = "muiTabThumb30"
- muiTabThumb30.Class = "GROUP"
- muiTabThumb30.Background = "BACKGROUND"
- muiTabThumb30.0 = "muiTabThumb300"
- muiTabThumb300.Class = "GROUP"
- muiTabThumb300.Columns = 4
- muiTabThumb300.0 = Label("border width")
- muiTabThumb300.1 = String("g_sbw")
- muiTabThumb300.2 = Label("inner space")
- muiTabThumb300.3 = String("g_thumbSpace")
- muiTabThumb300.4 = Label("gap")
- muiTabThumb300.5 = String("g_gap")
- muiTabThumb300.6 = Label("name size")
- muiTabThumb300.7 = String("g_font")
- muiTabThumb30.1 = "muiTabThumb301"
- muiTabThumb301.Class = "GROUP"
- muiTabThumb301.Frame = "GROUP"
- muiTabThumb301.FrameTitle = "thumbnail text"
- muiTabThumb301.0 = "g_thumbTextCycle"
- g_thumbTextCycle.Class = "CYCLE"
- g_thumbTextCycle.Entries = "%PICTURENAME/%PN - name|%PICTUREPATHFULL/%PPF - full path|%PICTUREPATHRELATIVE/%PPR - relative full path|%TYPE - picture type|%FACTOR - scale factor"
- muiTabThumb301.1 = "g_thumbText"
- g_thumbText.Class = "TEXTINPUTSCROLL"
- g_thumbText.Frame = "STRING"
- g_thumbText.MultiLine = 1
- g_thumbText.MaxLen = 2
- g_thumbText.MaxLines = 2
- g_thumbText.Lines = 1
- g_thumbText.Style = "MUI"
- g_thumbText.Contents = ParseText("\%PICTURENAME\n[\%TYPE - \%SCALE]")
- g_thumbText.Editable = 1
- /*---------------------------------------------*/
- muiPager.tab = "muiTabFile"; tab = tab + 1
- muiTabFile.Class = "GROUP"
- muiTabFile.Columns = 2
- muiTabFile.0 = HSpace(1)
- muiTabFile.1 = VSpace()
- muiTabFile.2 = Label("Directory to parse")
- muiTabFile.3 = "G_DIRASL"
- g_dirasl.Class = "POPASL"
- g_dirasl.Type = "FILE"
- g_dirasl.DrawersOnly = 1
- g_dirasl.Title = "picture directory..."
- g_dirasl.PositiveText = "ok"
- g_dirasl.NegativeText = "cancel"
- g_dirasl.RejectIcons = 1
- g_dirasl.String = String("g_dir")
- muiTabFile.4 = HSpace()
- muiTabFile.5 = "muiTC0"
- muiTC0.Class = "GROUP"
- muiTC0.Horiz = 1
- muiTC0.0 = Checkmark('g_rec',0)
- muiTC0.1 = Label("parse recursive")
- muiTC0.2 = HSpace()
- muiTabFile.6 = HSpace()
- muiTabFile.7 = "muiTC1"
- muiTC1.Class = "GROUP"
- muiTC1.Columns = 2
- muiTC1.0 = Label("directory pattern")
- muiTC1.1 = String("g_dirpattern")
- muiTC1.2 = Label("file pattern")
- muiTC1.3 = String("g_filepattern")
- muiTabFile.8 = HSpace(1)
- muiTabFile.9 = VSpace(5)
- muiTabFile.10 = Label("path for dumpfile")
- muiTabFile.11 = "G_DUMPASL"
- g_dumpasl.Class = "POPASL"
- g_dumpasl.Type = "FILE"
- g_dumpasl.Title = "path for dumpfile..."
- g_dumpasl.PositiveText = "ok"
- g_dumpasl.NegativeText = "cancel"
- g_dumpasl.RejectIcons = 1
- g_dumpasl.String = String("g_dump")
- muiTabFile.12 = HSpace()
- muiTabFile.13 = "muiTC2"
- muiTC2.Class = "GROUP"
- muiTC2.Horiz = 1
- muiTC2.0 = Checkmark('g_skip',0)
- muiTC2.1 = Label("skip old pics")
- muiTC2.2 = HSpace()
- muiTabFile.14 = HSpace(1)
- muiTabFile.15 = VSpace(5)
- muiTabFile.16 = Label("filename for saving")
- muiTabFile.17 = "G_SDIRASL"
- g_sdirasl.Class = "POPASL"
- g_sdirasl.Type = "FILE"
- g_sdirasl.Title = "save name..."
- g_sdirasl.PositiveText = "ok"
- g_sdirasl.NegativeText = "cancel"
- g_sdirasl.RejectIcons = 1
- g_sdirasl.String = String("g_sdir")
- muiTabFile.18 = HSpace(1)
- muiTabFile.19 = VSpace()
- /*---------------------------------------------*/
- muiPager.tab = "muiTab2"; tab = tab + 1
- muiTab2.Class = "GROUP"
- muiTab2.Columns = 2
- muiTab2.0 = HSpace(1)
- muiTab2.1 = VSpace()
- muiTab2.2 = Label("print method")
- muiTab2.3 = "g_method"
- g_method.Class = "CYCLE"
- g_method.Entries = "greyscale|color"
- g_method.Selected = 0
- muiTab2.4 = HSpace(1)
- muiTab2.5 = VSpace(5)
- muiTab2.6 = Label("print scale")
- muiTab2.7 = "g_scale"
- g_scale.Class = "CYCLE"
- g_scale.Entries = "actual size|scale to fit"
- g_scale.Selected = 0
- muiTab2.8 = HSpace(1)
- muiTab2.9 = VSpace()
- /*---------------------------------------------*/
- muiPager.tab = "muiTab3"; tab = tab + 1
- muiTab3.Class = "GROUP"
- muiTab3.Columns = 2
- muiTab3.0 = "muiTab3NL0"
- muiTab3NL0.Class = "NLISTVIEW"
- muiTab3NL0.List = "G_AVAIL"
- g_avail.Class = "NLIST"
- g_avail.AdjustHeight = 1
- g_avail.MultiSelect = "DEFAULT"
- g_avail.Title = ParseText('%cavailable types%n')
- g_avail.TitleClick = 1
- g_avail.DragType = "DEFAULT"
- g_avail.DragSortable = 1
- g_avail.DragSortInsert = 1
- g_avail.ShowDropMark = 1
- muiTab3.1 = "muiTab3NL1"
- muiTab3NL1.Class = "NLISTVIEW"
- muiTab3NL1.List = "G_SELECT"
- g_select.Class = "NLIST"
- g_select.AdjustHeight = 1
- g_select.MultiSelect = "DEFAULT"
- g_select.Title = ParseText('%cselected types%n')
- g_select.TitleClick = 1
- g_select.DragType = "DEFAULT"
- g_select.DragSortable = 1
- g_select.DragSortInsert = 1
- g_select.ShowDropMark = 1
- muiMainGroup.1 = "G_ACTION"
- g_action.Class = "CYCLE"
- g_action.ControlChar = "a"
- g_action.Entries = "collect|print|save"
- g_action.Selected = 0
- muiMainGroup.2 = "muiButtonGroup"
- muiButtonGroup.Class = "GROUP"
- muiButtonGroup.Columns = 2
- muiButtonGroup.0 = Button("G_OK", "_Ok" )
- muiButtonGroup.1 = Button("G_CANCEL", "_Cancel")
-
- /*
- ** create all
- */
- Call NewObj("APPLICATION","muiApp")
-
- /*
- ** window close gadget means quit...
- */
- Call Notify("muiWin", "CLOSEREQUEST", 1, "muiApp", "RETURNID", "QUIT")
-
- /*
- ** Cycles
- */
- Call Notify("G_SIZE", "ACTIVE", 0, "muiTabThumb001", "SET", "DISABLED", 1)
- Call Notify("G_SIZE", "ACTIVE", 0, "muiTabThumb000", "SET", "DISABLED", 0)
- Call Notify("G_SIZE", "ACTIVE", 1, "muiTabThumb001", "SET", "DISABLED", 0)
- Call Notify("G_SIZE", "ACTIVE", 1, "muiTabThumb000", "SET", "DISABLED", 1)
-
- Call Notify("G_FPO", "ACTIVE", 4, "G_FPOCUSTOM", "SET", "DISABLED", 0)
- Call Notify("G_FPO", "ACTIVE", 0, "G_FPOCUSTOM", "SET", "DISABLED", 1)
- Call Notify("G_FPO", "ACTIVE", 1, "G_FPOCUSTOM", "SET", "DISABLED", 1)
- Call Notify("G_FPO", "ACTIVE", 2, "G_FPOCUSTOM", "SET", "DISABLED", 1)
- Call Notify("G_FPO", "ACTIVE", 3, "G_FPOCUSTOM", "SET", "DISABLED", 1)
-
- /*
- ** Ok and Cancel Buttons...
- */
- Call Notify("G_CANCEL", "PRESSED", 0, "muiApp", "RETURNID")
- Call Notify("G_OK", "PRESSED", 0, "muiApp", "RETURNID")
- Call Notify("G_GRABMP", "PRESSED", 0, "muiApp", "RETURNID")
-
- /*
- ** Menu events...
- */
- Call Notify("muiMenuLoad", "MENUTRIGGER", "EVERYTIME", "muiApp", "RETURNID")
- Call Notify("muiMenuSave", "MENUTRIGGER", "EVERYTIME", "muiApp", "RETURNID")
- Call Notify("muiMenuSaveAs", "MENUTRIGGER", "EVERYTIME", "muiApp", "RETURNID")
- Call Notify("muiMenuPrefsMUI", "MENUTRIGGER", "EVERYTIME", "muiApp", "OpenConfigWindow")
-
- Call Notify("muiMenuAbout", "MENUTRIGGER", "EVERYTIME", "muiApp", "ABOUT", "muiWin")
- Call Notify("muiMenuAboutrxMUI", "MENUTRIGGER", "EVERYTIME", "muiApp", "ABOUTRXMUI", "muiWin")
- Call Notify("muiMenuAboutMUI", "MENUTRIGGER", "EVERYTIME", "muiApp", "ABOUTMUI", "muiWin")
- Call Notify("muiMenuQuit", "MENUTRIGGER", "EVERYTIME", "muiApp", "RETURNID")
-
- /*
- ** Button click -> about
- */
- Call Notify("muiBitmap", "PRESSED", 0, "muiApp", "ABOUT", "muiWin")
-
- Call DandD("g_select", "g_avail", "AUTO REMOVE")
- Call DandD("g_avail", "g_select", "AUTO REMOVE")
- Call Notify("g_select", "titleclick", "everytime", "g_select", "sort2", "triggervalue", "add2values")
- Call Notify("g_avail", "titleclick", "everytime", "g_avail", "sort2", "triggervalue", "add2values")
-
- Call Notify("muiPagerList", "ACTIVE", "EVERYTIME", "muiPager", "SET", "ACTIVEPAGE", "TRIGGERVALUE")
-
- /*
- ** Set active gadget at start
- */
- Call Set("muiWin", "ActiveObject", "G_OK")
- Call set("muiPagerList", "ACTIVE", 0)
-
- /*
- ** Set all the Cycle chains (here, because it will not work above!)
- */
- Call Set("muiPagerList", "CYCLECHAIN", 1)
-
- Call Set("g_top", "CYCLECHAIN", 1)
- Call Set("g_left", "CYCLECHAIN", 1)
- Call Set("g_bottom", "CYCLECHAIN", 1)
- Call Set("g_right", "CYCLECHAIN", 1)
- Call Set("g_grabMP", "CYCLECHAIN", 1)
- Call Set("g_pbw", "CYCLECHAIN", 1)
- Call Set("g_lsize", "CYCLECHAIN", 1)
- Call Set("g_sbw", "CYCLECHAIN", 1)
-
- Call Set("g_size", "CYCLECHAIN", 1)
- Call Set("g_x_num", "CYCLECHAIN", 1)
- Call Set("g_y_num", "CYCLECHAIN", 1)
- Call Set("g_x_size", "CYCLECHAIN", 1)
- Call Set("g_y_size", "CYCLECHAIN", 1)
- Call Set("g_upscale", "CYCLECHAIN", 1)
- Call Set("g_vertical", "CYCLECHAIN", 1)
- Call Set("g_fpo", "CYCLECHAIN", 1)
- Call Set("g_fpoCustom", "CYCLECHAIN", 1)
- Call Set("g_thumbSpace", "CYCLECHAIN", 1)
- Call Set("g_gap", "CYCLECHAIN", 1)
- Call Set("g_font", "CYCLECHAIN", 1)
- Call Set("g_thumbtextcycle", "CYCLECHAIN", 1)
- Call Set("g_thumbtext", "CYCLECHAIN", 1)
-
- Call Set("g_dir", "CYCLECHAIN", 1)
- Call Set("g_rec", "CYCLECHAIN", 1)
- Call Set("g_dirpattern", "CYCLECHAIN", 1)
- Call Set("g_filepattern", "CYCLECHAIN", 1)
- Call Set("g_dump", "CYCLECHAIN", 1)
- Call Set("g_skip", "CYCLECHAIN", 1)
- Call Set("g_sdir", "CYCLECHAIN", 1)
-
- Call Set("g_method", "CYCLECHAIN", 1)
- Call Set("g_scale", "CYCLECHAIN", 1)
-
- Call Set("g_avail", "CYCLECHAIN", 1)
- Call Set("g_select", "CYCLECHAIN", 1)
- Call Set("g_ok", "CYCLECHAIN", 1)
- Call Set("g_cancel", "CYCLECHAIN", 1)
- Call Set("g_action", "CYCLECHAIN", 1)
-
- /*
- ** Set all the short help texts
- */
- Call Set("g_top", "SHORTHELP", ParseText("Top side of the page"))
- Call Set("g_left", "SHORTHELP", ParseText("Left side of the page"))
- Call Set("g_right", "SHORTHELP", ParseText("Right side of the page"))
- Call Set("g_bottom", "SHORTHELP", ParseText("Bottom side of the page"))
- Call Set("g_grabMP", "SHORTHELP", ParseText("Get sizes from current MasterPage"))
- Call Set("g_pbw", "SHORTHELP", ParseText("Weight of page border."))
- Call Set("g_lsize", "SHORTHELP", ParseText("Size for text on bottom of the page."))
-
- Call Set("g_size", "SHORTHELP", ParseText("Select a maximum size for the thumbnails\nor the number per row/column"))
- Call Set("g_x_num", "SHORTHELP", ParseText("Number of thumbnails per row."))
- Call Set("g_y_num", "SHORTHELP", ParseText("Number of thumbnails per column."))
- Call Set("g_x_size", "SHORTHELP", ParseText("Maximum horizontal size of one thumbnail"))
- Call Set("g_y_size", "SHORTHELP", ParseText("Maximum vertical size of one thumbnail"))
- Call Set("g_upscale", "SHORTHELP", ParseText("Do not upscale smaller pictures"))
- Call Set("g_vertical", "SHORTHELP", ParseText("Place thumbnails vertically instead of horizontally"))
- Call Set("g_fpo", "SHORTHELP", ParseText("FPO resolution for the thumbnails"))
- Call Set("g_sbw", "SHORTHELP", ParseText("Weight of thumbnail border."))
- Call Set("g_thumbSpace", "SHORTHELP", ParseText("Space between thumbnails and thumbnailborder"))
- Call Set("g_gap", "SHORTHELP", ParseText("Gap between the thumbnails (horizontal AND vertical)."))
- Call Set("g_font", "SHORTHELP", ParseText("Size for the font names below the thumbnails.\nA textstyle called %bFontName%n will be used!"))
- Call Set("g_thumbtextcycle", "SHORTHELP", ParseText("All possible variables for the thumbnail text"))
- Call Set("g_thumbtext", "SHORTHELP", ParseText("Text for one thumbnail. Do NOT use quotes or special chars."))
-
- Call Set("g_dir", "SHORTHELP", ParseText("Path to look for pictures"))
- Call Set("g_rec", "SHORTHELP", ParseText("search recursive?"))
- Call Set("g_dirpattern", "SHORTHELP", ParseText("Pattern for directories to search"))
- Call Set("g_filepattern", "SHORTHELP", ParseText("Pattern for files to search"))
- Call Set("g_dump", "SHORTHELP", ParseText("Path for the dumpfile"))
- Call Set("g_skip", "SHORTHELP", ParseText("Skip pictures already in the dumpfile?"))
- Call Set("g_sdir", "SHORTHELP", ParseText("Save file name when selected SAVE as action"))
-
- Call Set("g_method", "SHORTHELP", ParseText("Print b/w or colored"))
- Call Set("g_scale", "SHORTHELP", ParseText("Scaled to fit or actual size output when selected PRINT"))
-
- Call Set("g_avail", "SHORTHELP", ParseText("File types NOT used"))
- Call Set("g_select", "SHORTHELP", ParseText("File types used to search for pictures. (rom top to bottom)"))
-
- Call Set("g_action", "SHORTHELP", ParseText("Collect, save or print the Catalog"))
- Call Set("g_ok", "SHORTHELP", ParseText("Start the Catalog generation"))
- Call Set("g_cancel", "SHORTHELP", ParseText("Leave program"))
-
- Return
- /* /// */
- /* /// BusyClose()
- */
- BusyClose:
- IF (muiBusyWinOpen = TRUE)
- THEN DO
- Call GetAttr("muiBusyWin", "OPEN", "o")
- IF (o ~= 0)
- THEN Call Set("muiBusyWin", "OPEN", 0)
- Call Dispose("muiBusyWin")
- muiBusyWinOpen = FALSE
- END
- Return
- /* /// */
- /* /// BusyHandle(bAnz, current1, current2, current3)
- */
- BusyHandle: PROCEDURE
- /*
- ** Handle the mui busy window for font loading...
- */
- PARSE ARG bAnz,current1,current2,current3
-
- IF (bAnz >= 1) THEN Call GetAttr("muiBusyGauge1", "MAX", max1)
- IF (bAnz >= 2) THEN Call GetAttr("muiBusyGauge2", "MAX", max2)
- IF (bAnz >= 3) THEN Call GetAttr("muiBusyGauge3", "MAX", max3)
-
- IF ((bAnz >= 1) & (current1 >= 0)) THEN Call BusyProgress(1, current1)
- IF ((bAnz >= 2) & (current2 >= 0)) THEN Call BusyProgress(2, current2)
- IF ((bAnz >= 3) & (current3 >= 0)) THEN Call BusyProgress(3, current3)
-
- /*
- ** this is the standard cycle to handle an application
- */
- ctrl_C = 2**12
- s = 0
- Call Handle("muiApp", "H", s)
- DO i = 0 TO (H.num - 1)
- id = H.i
- SELECT
- WHEN (id = "BUSY_CANCEL")
- THEN DO
- userCancel = 1
- END
- END
- END
- s = Wait( OR(h.signals, ctrl_C) )
- IF (AND(s, ctrl_C) ~= 0)
- THEN userCancel = 1
- Return userCancel
- /* /// */
- /* /// BusyOpen(title, bAnz, text1, text2, text3, total1, total2, total3)
- */
- BusyOpen:
- /*
- ** Open a MUI busy requester with a maximum of 3 sliders (should be enough)
- */
- userCancel = 0
- PARSE ARG title,bAnz,text1,text2,text3,total1,total2,total3
-
- /*
- ** let's define the window
- */
-
- muiBusyWin.ID = "BUSY"
- muiBusyWin.Title = ParseText(title)
- muiBusyWin.Contents = "muiBusyGroup"
- muiBusyWin.NoMenus = 1
-
- /*
- ** let's define the window contents
- ** (simply 3 versions... how lazy!)
- */
-
- muiBusyGroup.0 = "muiBusyGroup0"
- muiBusyGroup0.Class = "GROUP"
- muiBusyGroup0.Frame = "GROUP"
- muiBusyGroup0.Horiz = 0
- muiBusyGroup0.0 = "muiBusyText1"
- muiBusyText1.Class = "TEXT"
- muiBusyText1.Contents = ParseText(text1)
- muiBusyGroup0.1 = "muiBusyGauge1"
- muiBusyGauge1.Class = "GAUGE"
- muiBusyGauge1.Frame = "GAUGE"
- muiBusyGauge1.Horiz = 1
- muiBusyGauge1.InfoText = ""
- muiBusyGauge1.Max = total1
- muiBusyGauge1.Current = 0
- muiBusyGauge1.FixHeightTxt = 1
- IF (bAnz >= 2)
- THEN DO
- muiBusyGroup0.2 = "muiBusyText2"
- muiBusyText2.Class = "TEXT"
- muiBusyText2.Contents = ParseText(text2)
- muiBusyGroup0.3 = "muiBusyGauge2"
- muiBusyGauge2.Class = "GAUGE"
- muiBusyGauge2.Frame = "GAUGE"
- muiBusyGauge2.Horiz = 1
- muiBusyGauge2.InfoText = ""
- muiBusyGauge2.Max = total2
- muiBusyGauge2.Current = 0
- muiBusyGauge2.FixHeightTxt = 1
- END
- IF (bAnz = 3)
- THEN DO
- muiBusyGroup0.4 = "muiBusyText3"
- muiBusyText3.Class = "TEXT"
- muiBusyText3.Contents = ParseText(text3)
- muiBusyGroup0.5 = "muiBusyGauge3"
- muiBusyGauge3.Class = "GAUGE"
- muiBusyGauge3.Frame = "GAUGE"
- muiBusyGauge3.Horiz = 1
- muiBusyGauge3.InfoText = ""
- muiBusyGauge3.Max = total3
- muiBusyGauge3.Current = 0
- muiBusyGauge3.FixHeightTxt = 1
- END
-
- IF (bAnz = 1)
- THEN DO
- muiBusyGroup0.2 = HBar()
- muiBusyGroup0.3 = Button("BUSY_CANCEL", "_Cancel")
- END
- ELSE IF (bAnz = 2)
- THEN DO
- muiBusyGroup0.4 = HBar()
- muiBusyGroup0.5 = Button("BUSY_CANCEL", "_Cancel")
- END
- ELSE IF (bAnz = 3)
- THEN DO
- muiBusyGroup0.6 = HBar()
- muiBusyGroup0.7 = Button("BUSY_CANCEL", "_Cancel")
- END
-
- /*
- ** Busy Cancel Button...
- */
- Call Notify("BUSY_CANCEL", "PRESSED", 0, "muiApp", "SETVAR", "userCancel")
-
- /*
- ** generate new window object
- */
- res = NewObj("WINDOW","muiBusyWin",,1)
- IF (res ~= 0)
- THEN Call err(res)
- muiBusyWinOpen = TRUE
-
- /*
- ** Set active gadget at start
- */
- Call Set("muiBusyWin", "ActiveObject", "BUSY_CANCEL")
-
- /*
- ** to let the window be a bit larger....
- */
- Call Set("muiBusyGauge1", "INFOTEXT", ".............................................................................")
-
- /*
- ** Add window to application
- */
- Call Add("muiApp", "muiBusyWin")
-
- Call Set("muiBusyWin", "OPEN", 1)
- Call GetAttr("muiBusyWin", "OPEN", "o")
- IF (o = 0)
- THEN DO
- Say "can't open busy window!"
- Call ShowRequester("Can't open busy window! -> Exiting", "Sorry...")
- Call CleanUp
- END
- Return 1
- /* /// */
- /* /// BusyProgress(nr, current)
- */
- BusyProgress: PROCEDURE
- /*
- ** Set a new progress
- */
- PARSE ARG nr,current
-
- IF (nr = 1)
- THEN DO
- Call GetAttr("muiBusyGauge1", "MAX", max)
- Call Set("muiBusyGauge1", "CURRENT", Trunc(current))
- Call Set("muiBusyGauge1", "INFOTEXT", Trunc(100*current/max) ||"%")
- END
- ELSE IF (nr = 2)
- THEN DO
- Call GetAttr("muiBusyGauge2", "MAX", max)
- Call Set("muiBusyGauge2", "CURRENT", Trunc(current))
- Call Set("muiBusyGauge2", "INFOTEXT", Trunc(100*current/max) ||"%")
- END
- ELSE IF (nr = 3)
- THEN DO
- Call GetAttr("muiBusyGauge3", "MAX", max)
- Call Set("muiBusyGauge3", "CURRENT", Trunc(current))
- Call Set("muiBusyGauge3", "INFOTEXT", Trunc(100*current/max) ||"%")
- END
- Return userCancel
- /* /// */
- /* /// BusyText(nr, text)
- */
- BusyText:
- /*
- ** Set a new text for one gauge in the busy requester
- */
- PARSE ARG nr,text
-
- IF (nr = 1) THEN Call Set("muiBusyText1", "CONTENTS", ParseText(text))
- IF (nr = 2) THEN Call Set("muiBusyText2", "CONTENTS", ParseText(text))
- IF (nr = 3) THEN Call Set("muiBusyText3", "CONTENTS", ParseText(text)
- Return
- /* /// */
- /* /// CheckPrefsVersion(fileName)
- */
- CheckPrefsVersion:
- /*
- ** Check if prefsfile is compatible
- ** --------------------------------
- */
-
- PARSE ARG fileName
-
- IF (fileName = "")
- THEN fileName = standardPrefs
-
- ok = Open('Prefs', fileName, 'R')
- IF (ok = 1)
- THEN DO
- dummy = ReadLn('Prefs')
- cl = Close('Prefs')
-
- IF ( (Left(dummy, Length(pgsName)) = pgsName) | (Left(dummy, 3) = 'FSP') ) & (Right(dummy,4) >= pgsLVer)
- THEN Return 0
- END
- RETURN 1
- /* /// */
- /* /// CheckRoutines()
- */
- CheckRoutines:
- ADDRESS "PAGESTREAM"
-
- 'CURRENTWINDOWPATH'
- oldWinName = RESULT
-
- 'GETWINDOWPOS SIZE wp WINDOW "'oldWinName'"'
- wPw = wp.w
- wPh = wp.h
-
- 'GETPAGEMASTERPAGE MASTERPAGE mname WINDOW "'oldwinname'"'
- IF (RC = 10)
- THEN DO
- Call ShowRequester('Please open a new Document first.')
- ADDRESS PAGESTREAM 'LOCKINTERFACE FALSE'
- Call CleanUp()
- EXIT
- END
-
- 'CURRENTPAGE WINDOW "'oldwinname'"'
- pageNumber = RESULT
-
- IF ((pageNumber < 1) | (pageNumber > 999999))
- THEN DO
- /* maybe the user started from the masterpage?? */
- Call ShowRequester('Please go to a valid page and start again!')
- ADDRESS PAGESTREAM 'LOCKINTERFACE FALSE'
- Call CleanUp()
- EXIT
- END
-
- Return
- /* /// */
- /* /// CleanUp()
- */
- CleanUp:
-
- ADDRESS PAGESTREAM
- /*
- ** Close busy requester, clean up and leave program
- ** ------------------------------------------------
- */
-
- IF (muiBusyWinOpen = TRUE)
- THEN DO
- Call BusyClose()
- END
-
- /*
- ** reset the measurementsystem to the saved one!!
- */
- ''defmeasure''
-
- 'REFRESH ON'
- /*
- 'REFRESHWINDOW WINDOW "'|| oldWinName ||'"'
- */
- 'LOCKINTERFACE FALSE'
- EXIT
- /* /// */
- /* /// ConvertText2hex(rawText)
- */
- ConvertText2hex:
- PARSE ARG rawText
-
- rawHex = c2x(rawText)
- rawHex2 = ''
- DO k = 1 TO Length(rawHex)
- char = SubStr(rawHex, k, 2)
- SELECT
- /* line feed */
- WHEN char = '0A'
- THEN DO
- rawHex2 = rawHex2 || c2x('\n')
- END
- /* percent */
- WHEN char = '25'
- THEN DO
- rawHex2 = rawHex2 || c2x('\%')
- END
- OTHERWISE rawHex2 = rawHex2 || char
- END
- k = k + 1
- END
- Return rawHex2
- /* /// */
- /* /// ConvertTextToMultipleLines(src)
- */
- ConvertTextToMultipleLines:
- PARSE ARG src
-
- _num = 1
- _dest.num = _num
- _dest.0 = src
-
- DO FOREVER
- _prev = _num-1
- pos = Index(_dest._prev, '\n')
- IF (pos = 0)
- THEN LEAVE
-
- _dest._num = SubStr(_dest._prev, pos+2)
- _dest._prev = Left(_dest._prev, pos-1)
- _num = _num + 1
- END
- _dest.num = _num
- Return
- /* /// */
- /* /// ConvertToShortMeasurement(inp)
- */
- /*************************************************/
- /* convert long measurement to short measurement */
- /* (CENTIMETERS -> cm ...) */
- /*************************************************/
- ConvertToShortMeasurement:
- PARSE ARG inp
-
- long = 'INCHES CENTIMETERS MILLIMETERS PICAS POINTS PRINTERPICAS PRINTERPOINTS CICEROS DIDOTPOINTS FEET METERS'
- short = 'i cm mm p pt pp ppt c d f m'
-
- outp = ''
- DO k = 1 to Words(long)
-
- IF ( Word(long, k) = inp )
- THEN outp = Word(short, k)
- END
- IF (outp = '')
- THEN DO
- DO k = 1 to Words(long)
- IF (Word(long, k) = inp)
- THEN outp = Word(short, k)
- END
- END
- Return outp
- /* /// */
- /* /// DrawPageBorder()
- */
- DrawPageBorder:
- 'DISPLAY MPG RIGHT WINDOW "'oldwinname'"'
-
- d1 = prefs.leftGap + prefs.pageBorderWidth/2
- d2 = prefs.topGap +prefs.pageBorderWidth/2
- d3 = pagesizex-prefs.rightGap - prefs.pageBorderWidth/2
- d4 = pagesizey-prefs.bottomGap - prefs.pageBorderWidth/2 - (prefs.lSize+1)
-
- 'DRAWBOX 'd1 d2 d3 d4' WINDOW "'oldwinname'"'
- dummy = RESULT
- 'SETSTROKEWEIGHT 'prefs.pageBorderWidth' OBJECTID 'dummy
- 'SETSTROKEJOIN ROUND OBJECTID 'dummy
-
- IF (prefs.lSize > 0)
- THEN DO
- d1 = d1 - prefs.pageBorderWidth/2
- d3 = d3 + prefs.pageBorderWidth/2
- d4 = d4 + prefs.pageBorderWidth/2 + 1
- 'DRAWTEXTOBJ 'd1 d4' INFRONT WINDOW "'oldwinname'"'
- txtid = RESULT
- 'SELECTTEXT INOBJECT '|| txtid ||' REPLACE WINDOW "'oldwinname'"'
-
- bottomtwidth = d3 - d1
-
- 'BEGINCOMMANDCAPTURE'
- 'SETTRACKTABLE NONE'
- 'SETLEADING RELATIVE 100%'
- 'SETTYPESIZE "'prefs.lSize'"'
- 'ENDCOMMANDCAPTURE'
-
- 'INSERT "'||pgsName pgsVersion||' - '||pgsCopy||'" WINDOW "'oldwinname'"'
- 'SETTABRULER "RIGHT" 'bottomtwidth' WINDOW "'oldwinname'"'
- 'INSERTCONTROL TAB WINDOW "'oldwinname'"'
- 'INSERT "Page " WINDOW "'oldwinname'"'
- 'INSERTNUMBER PAGE WINDOW "'oldwinname'"'
- END
- 'DISPLAY PAGE 'pagenumber' WINDOW "'oldwinname'"'
- RETURN
- /* /// */
- /* /// DumpText(dumptxt)
- */
- DumpText:
- PARSE ARG dumptxt
-
- commands = prefs.PV_dump'PicCatalog.dumpfile'
- IF (Open('dump' ,commands, 'A') = 1)
- THEN DO
- wl = WriteLN('dump',dumptxt)
- cl = Close('dump')
- END
- RETURN
- /* /// */
- /* /// err(res)
- */
- err:
- PARSE ARG res
-
- ADDRESS 'PAGESTREAM'
- 'LOCKINTERFACE FALSE'
- 'REFRESH ON'
- 'REFRESHWINDOW WINDOW "'|| oldWinName ||'"'
- ''defmeasure''
- Call pgsRequester(GetRXmuiString(res) "in line" sigl-1)
- Exit
- /* /// */
- /* /// EventLoop()
- */
- EventLoop:
- /*
- ** this is the standard cycle to handle an application
- */
- ctrl_C = 2**12
- s = 0
- DO FOREVER
- Call Handle("muiApp", "H", s) /* THIS IS LINE prefs.rxMUI_LINE_1 = 954 */
- ws = 0
- DO i = 0 TO (H.num - 1)
- id = H.i
- SELECT
- WHEN (id = "QUIT") | (id = "G_CANCEL")
- THEN DO
- Call CleanUp
- EXIT
- END
-
- WHEN (id = "G_GRABMP")
- THEN DO
- Call PrefsWindowGet()
- Call GrabMasterPage()
- Call PrefsWindowSet()
- END
-
- WHEN (id = "MUIMENUPREFSMUI")
- THEN DO
- END
-
- WHEN (id = "MUIMENULOAD")
- THEN DO
- Call LoadPrefsAs()
- Call PrefsWindowSet()
- END
-
- WHEN (id = "MUIMENUSAVE")
- THEN DO
- Call PrefsWindowGet()
- Call SavePrefs()
- Call PrefsWindowSet()
- END
-
- WHEN (id = "MUIMENUSAVEAS")
- THEN DO
- Call PrefsWindowGet()
- Call SavePrefsAs()
- Call PrefsWindowSet()
- END
-
- WHEN (id = "MUIMENUQUIT")
- THEN DO
- IF (ShowRequester('Really Quit?', 'No|Yes') = 0)
- THEN DO
- Call CleanUp
- EXIT
- END
- END
-
- WHEN (id = "G_OK")
- THEN DO
- Return
- END
-
- OTHERWISE Say h.i
- END
- END
- IF (~ws) THEN Iterate
- s = Wait( OR(h.signals, ctrl_C) )
- IF (AND(s, ctrl_C) ~= 0)
- THEN EXIT
- END
- EXIT
- /* /// */
- /* /// FormatListsInitialize()
- */
- FormatListsInitialize:
- /*
- ** initialize the available list
- */
- Call DoMethod("G_AVAIL", "CLEAR")
- Call DoMethod("G_SELECT", "CLEAR")
-
- DO k=1 TO WORDS(prefs.PV_formats)
- DO r=1 TO WORDS(const.formats)
- /*
- ** only append entries which are available!
- */
- IF WORD(const.formats,r ) = WORD(prefs.PV_formats, k)
- THEN DO
- Call DoMethod("G_SELECT", "INSERT", WORD(prefs.PV_formats, k), "BOTTOM")
- r = WORDS(const.formats) + 1
- END
- END
- END
-
- DO k=1 TO WORDS(const.formats)
- found = 0
- DO r=1 TO WORDS(prefs.PV_formats)
- /*
- ** only append entries which are NOT selected!
- */
- IF WORD(const.formats, k) = WORD(prefs.PV_formats, r) THEN found = 1
- END
- IF (found = 0)
- THEN DO
- Call DoMethod("G_AVAIL", "INSERT", WORD(const.formats, k), "BOTTOM")
- END
- END
-
- Return
- /* /// */
- /* /// GetDefaultMeasurementSystem()
- */
- GetDefaultMeasurementSystem:
- PROCEDURE
-
- 'GETMEASUREMENTS COORDINATE stemc RELATIVE rel TEXT tex FROM fro'
- st = 'SETMEASUREMENTS COORDINATE 'stemc.horizontal stemc.vertical' RELATIVE 'rel' TEXT 'tex' FROM 'fro
- 'SETMEASUREMENTS COORDINATE POINTS SAMEAS RELATIVE SAMEAS TEXT POINTS FROM PAGE'
- Return st
- /* /// */
- /* /// GetFileName(prefName)
- */
- GetFileName:
- PARSE ARG fileName,text
- file = FilePart(fileName)
- path = PathPart(fileName)
-
- 'GETFILE TITLE "'|| text ||'" PATH "'|| path ||'" FILE "'|| file ||'"'
- IF (RC = 0)
- THEN fileName = RESULT
- ELSE fileName = 0
- Return fileName
- /* /// */
- /* /// GetLength(fileName)
- */
- GetLength:
- PROCEDURE EXPOSE BusyReq
- PARSE ARG filename
-
- ADDRESS COMMAND 'C:List 'filename' LFORMAT="%l" >T:PicCatalogLength.tmp'
- IF (Open('flength','T:PicCatalogLength.tmp','R') = 1)
- THEN DO
- l = ReadLN('flength')
- cl = Close('flength')
- ADDRESS COMMAND 'C:Delete >NIL: T:PicCatalogLength.tmp QUIET'
-
- IF (compare(l,'empty') = 0)
- THEN return 0
- ELSE return l
- END
- ELSE return 0
- RETURN ll
- /* /// */
- /* /// GrabMasterPage()
- */
- GrabMasterPage:
- ADDRESS 'PAGESTREAM'
-
- 'GETPAGEMASTERPAGE MASTERPAGE mname'
- IF (RC = 10)
- THEN DO
- Call ShowRequester('Please open a new Document first! Quit now!')
- Return
- END
-
- 'GETMEASUREMENTS COORDINATE stemc'
-
- IF (stemc.vertical = 'SAMEAS')
- THEN stemc.vertical = stemc.horizontal
-
- 'GETMARGINGUIDES guides'
-
- prefs.PV_left = guides.inside || ConvertToShortMeasurement(stemc.horizontal)
- prefs.PV_right = guides.outside || ConvertToShortMeasurement(stemc.horizontal)
- prefs.PV_top = guides.top || ConvertToShortMeasurement(stemc.vertical)
- prefs.PV_bottom = guides.bottom || ConvertToShortMeasurement(stemc.vertical)
- Return
- /* /// */
- /* /// LoadPrefs(fileName)
- */
- LoadPrefs:
-
- /*
- ** load the preferences file
- ** -------------------------
- */
-
- PARSE ARG fileName
- IF (fileName = "")
- THEN fileName = standardPrefs
-
- say 'loading 'fileName' ...'
-
- /*
- ** Check the version of the prefs file
- */
-
- IF (CheckPrefsVersion(fileName) ~= 0)
- THEN DO
- Call ShowRequester('Prefsfile not found or not valid! Using defaults.', 'Hmm...')
- Return
- END
- ELSE DO
- Call Open('Prefs', fileName, 'R')
- Say 'Reading prefs file...'
- dummy = ReadLN('Prefs')
- DO xx = 1 to 100
- command = ReadLn('Prefs')
- INTERPRET command
- IF EOF('Prefs') THEN LEAVE
- END
- Call Close('Prefs')
- END
- RETURN
- /* /// */
- /* /// LoadPrefsAs()
- */
- LoadPrefsAs:
- /*
- ** Load Prefs with selectable name
- ** -------------------------------
- */
-
- prefName = GetFileName(currentPrefs, 'Load Preferences...')
- IF (prefName ~= 0)
- THEN DO
- currentPrefs = prefName
- Call LoadPrefs(currentPrefs)
- END
- Return
- /* /// */
- /* /// pgsRequester(text)
- */
- pgsRequester:
- PARSE ARG meldung
-
- /*
- ** Convert to multiple lines
- */
-
- _num = 1
- mLines.num = _num
- mLines.0 = meldung
-
- DO FOREVER
- _prev = _num-1
- pos = Index(mLines._prev, '|')
- IF (pos = 0)
- THEN LEAVE
-
- mLines._num = SubStr(mLines._prev, pos+1)
- mLines._prev = Left(mLines._prev, pos-1)
- _num = _num + 1
- END
- mLines.num = _num
-
- l = 0
- DO kk = 0 TO mLines.num - 1
- IF (l < Length(mLines.kk) * 8)
- THEN l = Length(mLines.kk) * 8
- Say mLines.kk
- END
-
- ADDRESS "PAGESTREAM"
- 'ALLOCAREXXREQUESTER "error inside '|| pgsName ||'" '|| (l+20) (40 + mLines.num * 10)
- reqhandle = RESULT
-
- 'ADDAREXXGADGET '|| reqhandle ||' EXIT '|| (l/2 - 25) (20 + mLines.num * 10) ||' 50 LABEL "_Ok"'
- dummy = RESULT
-
- DO kk = 0 TO mLines.num - 1
- 'ADDAREXXGADGET 'reqhandle' TEXT 10 ' (10 + kk*10) l 'STRING "'mLines.kk'"'
- END
-
- 'DOAREXXREQUESTER 'reqhandle
- dummy = RESULT
-
- 'FREEAREXXREQUESTER 'reqhandle
- RETURN
- /* /// */
- /* /// PlaceGraphic(name)
- */
- PlaceGraphic:
- PARSE ARG name
-
- Call BusyText(1, "%c%bplacing picture%n\n%c"|| name ||"%n")
- Call BusyText(2, "%c%bloading...%n\n%c%n")
- Call BusyProgress(2, 30)
- IF (BusyHandle(1, 0, 0, 0) = 1)
- THEN DO
- Call CleanUp()
- EXIT
- END
-
- /*
- ** this prevents ARexx to show error messages (RC=10) if pictype is wrong
- */
- OPTIONS FAILAT 11
-
- pictypetext = ''
- pictype = 0
- fileget = 0
- document3 = 0
-
- /* ----------------------------------------------------------------- pgs3 documents! */
- DO fk = 1 TO WORDS(prefs.PV_formats)
- IF (WORD(prefs.PV_formats, fk) = 'PAGESTREAM3DOC')
- THEN pgsdoc = 1
- ELSE pgsdoc = 0
- END
-
- IF (pgsdoc = 1)
- THEN DO
- 'OPENDOCUMENT FILE "'name'" FILTER "IFFDOC"'
- IF (RC = 0)
- THEN DO
- wpw2 = wpw/2
- wph2 = wph/2
- 'SETWINDOWDEFAULTS SIZE 'wpw2 wph2
- 'REFRESH CONTINUE'
- 'OPENWINDOW "PICdumm" PAGE 1 SCALE "50%"'
-
- 'REFRESH WAIT'
- 'SETWINDOWDEFAULTS SIZE 'wpw wph
-
- 'GETPAGEMASTERPAGE MASTERPAGE mname2 DEPTH mwhere2 WINDOW "PICdumm"'
- mdisplayed = RESULT
-
- 'GETDIMENSIONS dim2 MASTERPAGE "'mname2'"'
- IF (dim2.orientation = 'PORTRAIT')
- THEN DO
- px2 = dim2.width
- py2 = dim2.height
- END
- ELSE DO
- px2 = dim2.height
- py2 = dim2.width
- END
-
- IF (mdisplayed = 'ON') /* document has a masterpage which is displayed ... */
- THEN DO
- 'DISPLAY MPG "'|| mname2 ||':RIGHT" SCALE "10%" WINDOW "PICdumm"'
- 'SELECTOBJECT ALL WINDOW "PICdumm"'
- 'UNLOCK WINDOW "PICdumm"'
- 'TRANSFORM 1 WINDOW "PICdumm"'
- 'MOVETOPAGE PAGE 1 WINDOW "PICdumm"'
- 'DISPLAY PAGE 1 SCALE "10%" WINDOW "PICdumm"'
- IF (mwhere2 = 'INBACK') THEN 'SENDTOBACK WINDOW "PICdumm"' /* ... in back */
- ELSE 'SENDTOFRONT WINDOW "PICdumm"' /* ... in front */
- END
- 'DRAWBOX 0 0 'px2 py2' WINDOW "PICdumm"'
- 'SELECTOBJECT ALL WINDOW "PICdumm"'
- 'UNLOCK WINDOW "PICdumm"'
- 'CREATEDRAWING BEST WINDOW "PICdumm"'
- 'COPYOBJECT WINDOW "PICdumm"'
-
- 'CLOSEDOCUMENT FORCE WINDOW "PICdumm"'
- 'REVEALWINDOW WINDOW "'oldwinname'"'
-
- 'PASTEOBJECT WINDOW "'oldwinname'"'
- picid = RESULT
- fileget = 1
- document3 = 1
- pictypetext = 'PGS3DOC'
- END
- END
- /* ----------------------------------------------------------------- bitmaps! */
-
- IF fileget = 0
- THEN DO
- DO fk = 1 TO WORDS(prefs.PV_formats)
- IF (WORD(prefs.PV_formats, fk) ~= 'PAGESTREAM3DOC')
- THEN DO
- /**/
- 'PLACEGRAPHIC FILE "'name'" FILTER "'WORD(prefs.PV_formats, fk)'" NOSTATUS WINDOW "'oldwinname'"'
- /**/
- /*
- 'DRAWPICTURE CONTENTOFFSET 0 0 FRAMED FILE "'name'" STORED "EXTERNAL" FPO "'|| const.fpo._pvfpo ||'" WINDOW "'oldwinname'"'
- */
- IF (RC = 0)
- THEN DO
- fileget = 1
- pictypetext = WORD(prefs.PV_formats, fk)
- LEAVE
- END
- END
- END
- END
-
- /* ------------------------------------------------------------- endfiletypes */
-
- OPTIONS FAILAT 10
-
- IF (fileget = 1)
- THEN DO
- /*
- ** remember FPO settings
- */
- _pvfpo = prefs.PV_fpo
- FPO_String = const.fpo._pvfpo
- IF FPO_String = 'CUSTOM'
- THEN FPO_String = FPO_String ||' '|| prefs.PV_fpoCustom ||' '|| prefs.PV_fpoCustom
- Call BusyText(2, "%c%bplacing...%n\n%c%n")
- Call BusyProgress(2, 60)
- 'GETOBJECT TYPE objtype WINDOW "'oldwinname'"'
- SELECT
- WHEN (objtype = 2 ) THEN pictype = 2
- WHEN (objtype = 12) THEN pictype = 1
- WHEN (objtype = 13) THEN pictype = 3
- END
- SELECT
- WHEN (pictype = 1) THEN 'GETPICTURE POSITION posi WINDOW "'oldwinname'"'
- WHEN (pictype = 2) THEN 'GETDRAWING POSITION posi WINDOW "'oldwinname'"'
- WHEN (pictype = 3) THEN 'GETEPS POSITION posi WINDOW "'oldwinname'"'
- END
- picid = RESULT
-
- d1 = startx
- d2 = starty
- oldStartx = startx
- oldStarty = starty
-
- pwidth = posi.right - posi.left
- pheight = posi.bottom - posi.top
-
- IF (prefs.PV_size = 0)
- THEN DO
- gsf = pwidth / pheight
- IF (gsf > psf0)
- THEN factor = (psx0 - 2*(prefs.sampleBorderWidth + prefs.thumbSpace)) / pwidth
- ELSE factor = (psy0nt - 2*(prefs.sampleBorderWidth + prefs.thumbSpace)) / pheight
-
- IF (prefs.PV_upscale = 1)
- THEN IF (factor > 1) THEN factor = 1
-
- newpwidth = (factor * pwidth)
- newpheight = (factor * pheight)
-
- centerdeltax = (psx0 - newpwidth) / 2
- centerdeltay = (psy0nt - newpheight) / 2
-
- d3 = d1 + psx0
- d4 = d2 + psy0
-
- IF (prefs.PV_vertical = 0)
- THEN DO
- /*
- ** vertical mode is off:
- ** 1. check if too far right -> next row
- */
- IF ((d3 - 1) > (pagesizex - prefs.rightGap - prefs.pageBorderWidth - prefs.gap))
- THEN DO
- startx = prefs.leftGap + prefs.pageBorderWidth + prefs.gap
- starty = d4 + prefs.gap
- d1 = startx
- d2 = starty
- d3 = d1 + psx0
- d4 = d2 + psy0
- END
-
- /*
- ** 2. check if too far down -> next page
- */
- IF ((d4 - 1) > (pagesizey - prefs.bottomGap - prefs.pageBorderWidth - (prefs.lSize+1) - prefs.gap))
- THEN DO
- startx = prefs.leftGap + prefs.pageBorderWidth + prefs.gap
- starty = prefs.topGap + prefs.pageBorderWidth + prefs.gap
- lastpic = 1 /* last picture already placed! print or flip page and go on... */
- 'DELETEOBJECT OBJECTID 'picid' WINDOW "'oldwinname'"'
- RETURN 1
- END
- startx = d1 + psx0 + prefs.gap
- END
- ELSE DO
- /*
- ** vertical mode is on:
- ** 1. check if too far down -> next column
- */
- IF ((d4 - 1) > (pagesizey - prefs.bottomGap - prefs.pageBorderWidth - (prefs.lSize+1) - prefs.gap))
- THEN DO
- startx = d3 + prefs.gap
- starty = prefs.topgap + prefs.pageBorderWidth + prefs.gap
- d1 = startx
- d2 = starty
- d3 = d1 + psx0
- d4 = d2 + psy0
- END
-
- /*
- ** 2. check if too far right -> next page
- */
- IF ((d3 - 1) > (pagesizex - prefs.rightGap - prefs.pageBorderWidth - prefs.gap))
- THEN DO
- startx = prefs.leftgap + prefs.pageBorderWidth + prefs.gap
- starty = prefs.topgap + prefs.pageBorderWidth + prefs.gap
- lastpic = 1 /* last picture already placed! print or flip page and go on... */
- 'DELETEOBJECT OBJECTID 'picid' WINDOW "'oldwinname'"'
- RETURN 1
- END
- starty = d2 + psy0 + prefs.gap
- END
-
- /* calculate the new position and dimensions of the sample */
- newl = d1 + centerdeltax
- newt = d2 + centerdeltay
- newr = newl + newpwidth
- newb = newt + newpheight
- SELECT
- WHEN (pictype = 1)
- THEN 'EDITPICTURE POSITION 'newl newt newr newb' STORED EXTERNAL FPO '|| FPO_String ||' OBJECTID 'picid
- WHEN (pictype = 2)
- THEN IF (document3 = 1)
- THEN 'EDITDRAWING POSITION 'newl newt newr newb' OBJECTID 'picid
- ELSE 'EDITDRAWING POSITION 'newl newt newr newb' stored "EXTERNAL" OBJECTID 'picid
- OTHERWISE 'EDITEPS POSITION 'newl newt newr newb' stored "EXTERNAL" OBJECTID 'picid
- END
- END
- ELSE DO
- gsf = pwidth / pheight
- IF (gsf > psf1) THEN factor = psx1 / pwidth
- ELSE factor = psy1 / pheight
-
- IF (prefs.PV_upscale)
- THEN IF (factor > 1) THEN factor = 1
-
- newpwidth = factor * pwidth
- newpheight = factor * pheight
-
- d3 = d1 + newpwidth + 2*(prefs.sampleBorderWidth + prefs.thumbSpace)
- d4 = d2 + newpheight + 2*(prefs.sampleBorderWidth + prefs.thumbSpace) + prefs.txtLines*(prefs.txtSize+1)
-
-
- IF (prefs.PV_vertical = 0)
- THEN DO
- /*
- ** vertical mode is off:
- ** 1. check if too far right -> next row
- */
- IF ((d3 - 1) > (pagesizex - prefs.rightGap - prefs.pageBorderWidth - prefs.gap))
- THEN DO
- startx = prefs.leftGap + prefs.pageBorderWidth + prefs.gap
- starty = d2 + maxheight + 2*(prefs.sampleBorderWidth + prefs.thumbSpace) + prefs.txtLines*(prefs.txtSize + 1) + prefs.gap
- d1 = startx
- d2 = starty
- d3 = d1 + newpwidth + 2*(prefs.sampleBorderWidth + prefs.thumbSpace)
- d4 = d2 + newpheight + 2*(prefs.sampleBorderWidth + prefs.thumbSpace) + prefs.txtLines*(prefs.txtSize+1)
- IF ((d3 - 1) > (pagesizex - prefs.rightGap - prefs.pageBorderWidth - prefs.gap))
- THEN DO
- IF (prefs.errorSkip = 0)
- THEN DO
- res = SizeError()
- IF (res = 2)
- THEN DO
- prefs.errorSkip = 1
- END
- END
- IF (prefs.errorSkip = 1) | (res = 1)
- THEN DO
- Call BusyText(2, "%c%bskipping current picture...%n\n%c%n")
- Call BusyProgress(2, 100)
- Call DumpText('('||pNum||') '||name||' -> ...skipped')
- 'DELETEOBJECT OBJECTID 'picid
- startx = oldStartx
- starty = oldStarty
- Return 0
- END
- END
- maxheight = 0
- maxwidth = 0
- END
-
- /*
- ** 2. check if too far down -> next page
- */
- IF ((d4 - 1) > (pagesizey - prefs.bottomGap - prefs.pageBorderWidth - (prefs.lSize+1) - prefs.gap))
- THEN DO
- startx = prefs.leftGap + prefs.pageBorderWidth + prefs.gap
- starty = prefs.topGap + prefs.pageBorderWidth + prefs.gap
- IF ((starty + newpheight + 2*(prefs.sampleBorderWidth + prefs.thumbSpace) + prefs.txtLines*(prefs.txtSize+1)) > (pagesizey - prefs.bottomGap - prefs.pageBorderWidth - (prefs.lSize+1) - prefs.gap))
- THEN DO
- IF (prefs.errorSkip = 0)
- THEN DO
- res = SizeError()
- IF (res = 2)
- THEN DO
- prefs.errorSkip = 1
- END
- END
- IF (prefs.errorSkip = 1) | (res = 1)
- THEN DO
- Call BusyText(2, "%c%bskipping current picture...%n\n%c%n")
- Call BusyProgress(2, 100)
- Call DumpText('('||pNum||') '||name||' -> ...skipped')
- 'DELETEOBJECT OBJECTID 'picid
- startx = oldStartx
- starty = oldStarty
- Return 0
- END
- END
- maxheight = 0
- maxwidth = 0
- lastpic = 1 /* last picture already placed! print or flip page and go on... */
- 'DELETEOBJECT OBJECTID 'picid
- RETURN 1
- END
- startx = d3 + prefs.gap
- END
- ELSE DO
- /*
- ** vertical mode is on:
- ** 1. check if too far down -> next column
- */
-
- IF ((d4 - 1) > (pagesizey - prefs.bottomGap - prefs.pageBorderWidth - (prefs.lSize+1) - prefs.gap))
- THEN DO
- startx = d1 + maxwidth + 2*(prefs.sampleBorderWidth + prefs.thumbSpace) + prefs.gap
- starty = prefs.topGap + prefs.pageBorderWidth + prefs.gap
- d1 = startx
- d2 = starty
- d3 = d1 + newpwidth + 2*(prefs.sampleBorderWidth + prefs.thumbSpace)
- d4 = d2 + newpheight + 2*(prefs.sampleBorderWidth + prefs.thumbSpace) + prefs.txtLines*(prefs.txtSize+1)
- IF ((d4 - 1) > (pagesizey - prefs.bottomGap - prefs.pageBorderWidth - (prefs.lSize+1) - prefs.gap))
- THEN DO
- IF (prefs.errorSkip = 0)
- THEN DO
- res = SizeError()
- IF (res = 2)
- THEN DO
- prefs.errorSkip = 1
- END
- END
- IF (prefs.errorSkip = 1) | (res = 1)
- THEN DO
- Call BusyText(2, "%c%bskipping current picture...%n\n%c%n")
- Call BusyProgress(2, 100)
- Call DumpText('('||pNum||') '||name||' -> ...skipped')
- 'DELETEOBJECT OBJECTID 'picid
- startx = oldStartx
- starty = oldStarty
- Return 0
- END
- END
- maxheight = 0
- maxwidth = 0
- END
-
- /*
- ** 2. check if too far right -> next page
- */
- IF ((d3 - 1) > (pagesizex - prefs.rightGap - prefs.pageBorderWidth - prefs.gap))
- THEN DO
- startx = prefs.leftGap + prefs.pageBorderWidth + prefs.gap
- starty = prefs.topGap + prefs.pageBorderWidth + prefs.gap
- IF ((startx + newpwidth + 2*(prefs.sampleBorderWidth + prefs.thumbSpace)) > (pagesizex - prefs.rightGap - prefs.pageBorderWidth - prefs.gap))
- THEN DO
- IF (prefs.errorSkip = 0)
- THEN DO
- res = SizeError()
- IF (res = 2)
- THEN DO
- prefs.errorSkip = 1
- END
- END
- IF (prefs.errorSkip = 1) | (res = 1)
- THEN DO
- Call BusyText(2, "%c%bskipping current picture...%n\n%c%n")
- Call BusyProgress(2, 100)
- Call DumpText('('||pNum||') '||name||' -> ...skipped')
- 'DELETEOBJECT OBJECTID 'picid
- startx = oldStartx
- starty = oldStarty
- Return 0
- END
- END
- maxheight = 0
- maxwidth = 0
- lastpic = 1 /* last picture already placed! print or flip page and go on... */
- 'DELETEOBJECT OBJECTID 'picid
- RETURN 1
- END
- starty = d4 + prefs.gap
- END
- /*
- ** remember maximum width and height of the sample
- */
- IF (newpheight > maxheight)
- THEN maxheight = newpheight
-
- IF (newpwidth > maxwidth)
- THEN maxwidth = newpwidth
-
- newl = d1 + (prefs.sampleBorderWidth + prefs.thumbSpace)
- newt = d2 + (prefs.sampleBorderWidth + prefs.thumbSpace)
- newr = newl + newpwidth
- newb = newt + newpheight
-
- SELECT
- WHEN (pictype = 1)
- THEN 'EDITPICTURE POSITION 'newl newt newr newb' STORED EXTERNAL FPO '|| FPO_String ||' OBJECTID 'picid
- WHEN (pictype = 2)
- THEN IF (document3 = 1)
- THEN 'EDITDRAWING POSITION 'newl newt newr newb' OBJECTID 'picid
- ELSE 'EDITDRAWING POSITION 'newl newt newr newb' stored "EXTERNAL" OBJECTID 'picid
- OTHERWISE
- 'EDITEPS POSITION 'newl newt newr newb' stored "EXTERNAL" OBJECTID 'picid
- END
- END
-
- IF (prefs.txtSize > 0)
- THEN DO
- d41 = d4 - prefs.txtLines*(prefs.txtSize + 1)
- 'DRAWTEXTOBJ 'd1 d41' INFRONT WINDOW "'oldwinname'"'
- txtid = RESULT
- 'SELECTTEXT INOBJECT '|| txtid ||' REPLACE WINDOW "'oldwinname'"'
-
- 'BEGINCOMMANDCAPTURE'
- 'SETTRACKTABLE NONE'
- 'SETLEADING RELATIVE 100%'
- 'SETTYPESIZE 'prefs.txtSize
- 'SETPARAGRAPHSTYLE "PicName"'
- 'ENDCOMMANDCAPTURE'
-
- /*
- ** prepare the thumbnail text
- */
- factorText = Trunc(factor * 100,2)/1 || '%'
- nameReverse = Reverse(name)
- pos = Pos('/', nameReverse)
- IF (pos = 0)
- THEN pos = Pos(':', nameReverse)
- namePic = Right(name, pos-1)
- namePathComplete = Left(name, Length(name)-(pos-1))
- IF (Index(namePathComplete, prefs.PV_dir) > 0)
- THEN DO
- namePathRelative = DelStr(namePathComplete, 1, Length(prefs.PV_dir))
- IF (namePathRelative = '')
- THEN namePathRelative = ':'
- END
-
- /*
- ** abbreviations for the text
- ** %PICTURENAME / %PN : pure name
- ** %PICTUREPATHFULL / %PPF : path full
- ** %PICTUREPATHRELATIVE / %PPR : path relative
- ** %TYPE : picture type
- ** %FACTOR : scale factor
- */
-
- DO tk = 0 TO (prefs.thumbText.num - 1)
- infoText.tk = prefs.thumbText.tk
- /* Picture Name */
- infoText.tk = ReplaceItemInText(infoText.tk, '\%PICTURENAME', namePic)
- infoText.tk = ReplaceItemInText(infoText.tk, '\%PN', namePic)
- /* Picture Path Full */
- infoText.tk = ReplaceItemInText(infoText.tk, '\%PICTUREPATHFULL', namePathComplete)
- infoText.tk = ReplaceItemInText(infoText.tk, '\%PPF', namePathComplete)
- /* Picture Path Relative */
- infoText.tk = ReplaceItemInText(infoText.tk, '\%PICTUREPATHRELATIVE', namePathRelative)
- infoText.tk = ReplaceItemInText(infoText.tk, '\%PPR', namePathRelative)
- /* FileType */
- infoText.tk = ReplaceItemInText(infoText.tk, '\%TYPE', picTypeText)
- /* scale factor */
- infoText.tk = ReplaceItemInText(infoText.tk, '\%SCALE', factorText)
- END
-
- d41 = d4 - prefs.txtLines*(prefs.txtSize + 1)
- DO tk = 0 TO (prefs.thumbText.num - 1)
- 'DRAWTEXTOBJ 'd1 d41' INFRONT WINDOW "'oldwinname'"'
- txtid = RESULT
- 'SELECTTEXT INOBJECT '|| txtid ||' REPLACE WINDOW "'oldwinname'"'
-
- 'BEGINCOMMANDCAPTURE'
- 'SETTRACKTABLE NONE'
- 'SETLEADING RELATIVE 100%'
- 'SETTYPESIZE 'prefs.txtSize
- 'SETPARAGRAPHSTYLE "PicName"'
- 'ENDCOMMANDCAPTURE'
-
- 'INSERT "'|| infoText.tk ||'"'
- 'GETTEXTOBJ POSITION txtpos OBJECTID 'txtid
- txtp2.left = txtpos.left
- txtp2.top = txtpos.top
- txtp2.bottom = txtpos.bottom
- txtp2.right = txtpos.right
-
- txtwidth = txtp2.right - txtp2.left
- IF (txtwidth > (d3-d1))
- THEN 'EDITTEXTOBJ POSITION 'txtp2.left txtp2.top d3 txtp2.bottom' OBJECTID 'txtid
-
- d41 = d41 + prefs.txtSize + 1
- END
- END
-
- d11 = d1 + prefs.sampleBorderWidth/2
- d21 = d2 + prefs.sampleBorderWidth/2
- d31 = d3 - prefs.sampleBorderWidth/2
- d41 = d4 - prefs.txtLines*(prefs.txtSize+1) - prefs.sampleBorderWidth/2
-
- 'DRAWBOX 'd11 d21 d31 d41' WINDOW "'oldwinname'"'
- dummy = RESULT
- 'SETSTROKEWEIGHT 'prefs.sampleBorderWidth' OBJECTID 'dummy
- 'SETSTROKEJOIN BEVEL OBJECTID 'dummy
-
- nppp = nppp + 1
- Call DumpText('('||pNum||') '||name||' -> ...created')
- END
- ELSE DO
- Call BusyText(2, "%c%bscanning directories...%n\n%c%n")
- Call BusyProgress(2, 30)
- Call DumpText('('||pNum||') '||name||' -> ...NOT created')
- END
- RETURN 0
- /* /// */
- /* /// PictureCatalog()
- */
- PictureCatalog:
-
- ADDRESS 'PAGESTREAM'
-
- /*
- ** get default measurement system and switch to points
- */
-
- defmeasure = GetDefaultMeasurementSystem()
-
- /*
- ** get master page dimensions
- */
-
- 'GETDIMENSIONS dim MASTERPAGE "'mname'" WINDOW "'oldwinname'"'
- IF (dim.orientation = 'PORTRAIT')
- THEN DO
- rpagesizex = dim.width
- rpagesizey = dim.height
- END
- ELSE DO
- rpagesizex = dim.height
- rpagesizey = dim.width
- END
-
- /*
- ** convert prefs to points measurement
- */
-
- Call ConvertTextToMultipleLines(x2c(prefs.PV_thumbText))
- prefs.thumbText.num = _dest.num
- DO k = 0 TO (_dest.num - 1)
- prefs.thumbText.k = _dest.k
- END
-
- pagesizex = rpagesizex
- pagesizey = rpagesizey
-
- prefs.leftGap = p2d(prefs.PV_left, const.measure)
- prefs.rightGap = p2d(prefs.PV_right, const.measure)
- prefs.topGap = p2d(prefs.PV_top, const.measure)
- prefs.bottomGap = p2d(prefs.PV_bottom, const.measure)
- prefs.pageBorderWidth = p2d(prefs.PV_pbw, const.measure)
- prefs.lSize = p2d(prefs.PV_lSize, const.measure)
- prefs.thumbSpace = p2d(prefs.PV_thumbSpace, const.measure)
- prefs.gap = p2d(prefs.PV_gap, const.measure)
- prefs.sampleBorderWidth = p2d(prefs.PV_sbw, const.measure)
- prefs.txtSize = p2d(prefs.PV_font, const.measure)
- numx0 = prefs.PV_x_num
- numy0 = prefs.PV_y_num
- /*
- ** calculate start position for first thumbnail
- */
- startx = prefs.leftGap + prefs.pageBorderWidth + prefs.gap
- starty = prefs.topGap + prefs.pageBorderWidth + prefs.gap
-
- /*
- ** calculate size for one thumbnail if horizontal and vertical
- ** numbers are specified
- */
- prefs.txtLines = prefs.thumbText.num
- psx0 = (pagesizeX - prefs.leftGap - prefs.rightGap - 2*prefs.pageBorderWidth - (numx0 + 1)*prefs.gap) / numx0
- psy0 = (pagesizeY - prefs.topGap - prefs.bottomGap - (prefs.lSize + 1) - 2*prefs.pageBorderWidth - (numy0 + 1)*prefs.gap) / numy0
- psy0nt = psy0 - prefs.txtLines*(prefs.txtSize+1)
-
- psf0 = (psx0 - 2*(prefs.sampleBorderWidth + 1)) / (psy0nt - 2*(prefs.sampleBorderWidth + 1))
- anzp = numx0 * numy0
-
- /*
- ** calculate size for one thumbnail if horizontal and vertical
- ** sizes for one thumbnail are specified
- */
-
- psx1 = p2d(prefs.PV_x_size, const.measure)
- psy1 = p2d(prefs.PV_y_size, const.measure)
- psf1 = psx1 / psy1
-
- oldfilename = 'NONE'
-
- commands = 'C:Copy >NIL: "'prefs.PV_dump'PicCatalog.dumpfile" "'prefs.PV_dump'PicCatalog.dumpfileOLD" QUIET'
- ADDRESS COMMAND commands
- commands = prefs.PV_dump'PicCatalog.dumpfile'
- IF (Open('dump', commands, 'W') = 1)
- THEN DO
- wl = WriteLN('dump','DUMPFILE for '|| pgsName pgsVersion ||' - '|| pgsCopy ||'')
- cl = Close('dump')
- END
-
- pNum = 0
- nppp = 0
- maxheight = 0
- maxwidth = 0
-
- /*
- ** draw the border on master page
- */
-
- CALL DrawPageBorder
-
- 'REFRESH WAIT'
-
- /*
- ** work directory
- */
-
- dummy = RekDir(prefs.PV_dir)
-
- IF (nppp=0) THEN 'DELETEPAGE'
- IF ((nppp > 0) & (prefs.PV_action = 1))
- THEN DO /* ready but not yet printed */
- Call BusyText(2, "%c%brefreshing display%n\n%c...%n")
- Call BusyProgress(2, 50)
- 'REFRESH CONTINUE'
- 'REFRESHWINDOW WINDOW "'oldWinName'"'
-
- CALL PrintPage
- END
-
- IF ((nppp > 0) & (prefs.PV_action = 2))
- THEN DO /* ready but not yet saved */
- Call BusyText(2, "%c%brefreshing display%n\n%c...%n")
- Call BusyProgress(2, 50)
- 'REFRESH CONTINUE'
- 'REFRESHWINDOW WINDOW "'oldWinName'"'
- CALL SaveDocument
- END
-
- CALL CLEANUP
- RETURN
- /* /// */
- /* /// PrefsWindowGet()
- */
- PrefsWindowGet:
-
- Call GetAttr("g_top", "CONTENTS", "prefs.PV_top")
- Call SetCorrectMSys('prefs.PV_top')
- Call GetAttr("g_left", "CONTENTS", "prefs.PV_left")
- Call SetCorrectMSys('prefs.PV_left')
- Call GetAttr("g_bottom", "CONTENTS", "prefs.PV_bottom")
- Call SetCorrectMSys('prefs.PV_bottom')
- Call GetAttr("g_right", "CONTENTS", "prefs.PV_right")
- Call SetCorrectMSys('prefs.PV_right')
- Call GetAttr("g_pbw", "CONTENTS", "prefs.PV_pbw")
- Call SetCorrectMSys('prefs.PV_pbw')
- Call GetAttr("g_lsize", "CONTENTS", "prefs.PV_lsize")
- Call SetCorrectMSys('prefs.PV_lsize')
-
- Call GetAttr("g_size", "ACTIVE", "prefs.PV_size")
- Call GetAttr("g_x_num", "VALUE", "prefs.PV_x_num")
- Call GetAttr("g_y_num", "VALUE", "prefs.PV_y_num")
- Call GetAttr("g_x_size", "CONTENTS", "prefs.PV_x_size")
- Call SetCorrectMSys('prefs.PV_x_size')
- Call GetAttr("g_y_size", "CONTENTS", "prefs.PV_y_size")
- Call SetCorrectMSys('prefs.PV_y_size')
- Call GetAttr("g_upscale", "SELECTED", "prefs.PV_upscale")
- Call GetAttr("g_vertical", "SELECTED", "prefs.PV_vertical")
- Call GetAttr("g_sbw", "CONTENTS", "prefs.PV_sbw")
- Call SetCorrectMSys('prefs.PV_sbw')
- Call GetAttr("g_thumbSpace", "CONTENTS", "prefs.PV_thumbSpace")
- Call SetCorrectMSys('prefs.PV_thumbSpace')
- Call GetAttr("g_gap", "CONTENTS", "prefs.PV_gap")
- Call SetCorrectMSys('prefs.PV_gap')
- Call GetAttr("g_font", "CONTENTS", "prefs.PV_font")
- Call SetCorrectMSys('prefs.PV_font')
- Call GetAttr("g_thumbtext", "CONTENTS", "rawText")
- prefs.PV_thumbText = ConvertText2hex(rawText)
- Call GetAttr("g_fpo", "ACTIVE", "prefs.PV_fpo")
- Call GetAttr("g_fpoCustom", "CONTENTS", "prefs.PV_fpoCustom")
-
- Call GetAttr("g_dir", "CONTENTS", "prefs.PV_dir")
- Call GetAttr("g_rec", "SELECTED", "prefs.PV_rec")
- Call GetAttr("g_dirPattern", "CONTENTS", "prefs.PV_dirPattern")
- Call GetAttr("g_filePattern", "CONTENTS", "prefs.PV_filePattern")
- Call GetAttr("g_dump", "CONTENTS", "prefs.PV_dump")
- Call GetAttr("g_skip", "SELECTED", "prefs.PV_skip")
- Call GetAttr("g_sdir", "CONTENTS", "prefs.PV_sdir")
-
- Call GetAttr("g_method", "ACTIVE", "prefs.PV_method")
- Call GetAttr("g_scale", "ACTIVE", "prefs.PV_scale")
-
- Call GetAttr("g_action", "ACTIVE", "prefs.PV_action")
-
- /*
- ** also get the selected objects
- */
- Call DoMethod("G_SELECT", "GETENTRIES", rFormats)
- prefs.PV_formats = ''
- IF (rFormats.num >= 0)
- THEN DO
- prefs.PV_formats = rFormats.0
- DO k=1 to (rFormats.num)
- prefs.PV_formats = prefs.PV_formats' 'rFormats.k
- END
- END
-
- Return
- /* /// */
- /* /// PrefsWindowSet()
- */
- PrefsWindowSet:
- Call Set("g_top", "CONTENTS", prefs.PV_top)
- Call Set("g_left", "CONTENTS", prefs.PV_left)
- Call Set("g_bottom", "CONTENTS", prefs.PV_bottom)
- Call Set("g_right", "CONTENTS", prefs.PV_right)
- Call Set("g_pbw", "CONTENTS", prefs.PV_pbw)
- Call Set("g_lsize", "CONTENTS", prefs.PV_lsize)
-
- Call Set("g_size", "ACTIVE", prefs.PV_size)
- Call Set("g_x_num", "VALUE", prefs.PV_x_num)
- Call Set("g_y_num", "VALUE", prefs.PV_y_num)
- Call Set("g_x_size", "CONTENTS", prefs.PV_x_size)
- Call Set("g_y_size", "CONTENTS", prefs.PV_y_size)
- Call Set("g_upscale", "SELECTED", prefs.PV_upscale)
- Call Set("g_vertical", "SELECTED", prefs.PV_vertical)
- Call Set("g_fpo", "ACTIVE", prefs.PV_fpo)
- Call Set("g_fpoCustom", "CONTENTS", prefs.PV_fpoCustom)
- Call Set("g_sbw", "CONTENTS", prefs.PV_sbw)
- Call Set("g_thumbSpace", "CONTENTS", prefs.PV_thumbSpace)
- Call Set("g_gap", "CONTENTS", prefs.PV_gap)
- Call Set("g_font", "CONTENTS", prefs.PV_font)
- Call Set("g_thumbtext", "CONTENTS", parseText(x2c(prefs.PV_thumbText)))
-
- Call Set("g_dir", "CONTENTS", prefs.PV_dir)
- Call Set("g_rec", "SELECTED", prefs.PV_rec)
- Call Set("g_dirPattern", "CONTENTS", prefs.PV_dirPattern)
- Call Set("g_filePattern", "CONTENTS", prefs.PV_filePattern)
- Call Set("g_dump", "CONTENTS", prefs.PV_dump)
- Call Set("g_skip", "SELECTED", prefs.PV_skip)
- Call Set("g_sdir", "CONTENTS", prefs.PV_sdir)
-
- Call Set("g_method", "ACTIVE", prefs.PV_method)
- Call Set("g_scale", "ACTIVE", prefs.PV_scale)
-
- Call Set("g_action", "ACTIVE", prefs.PV_action)
-
- Call FormatListsInitialize()
-
- Return
- /* /// */
- /* /// PrintPage()
- */
- PrintPage:
- output.0 = 'GRAYSCALE'
- output.1 = 'COLOR'
-
- CALL DumpText('----- printing page -----')
-
- Call BusyText(2, "%c%bprinting page%n\n%c"|| pagenumber ||"%n")
- Call BusyProgress(2, 100)
-
- prm = prefs.PV_method
-
- IF (prefs.PV_scale = 0)
- THEN DO
- 'PRINTDOCUMENT PAGE "" OUTPUT '|| output.prm ||' SCALE "ACTUAL"'
- END
- IF (prefs.PV_scale = 1)
- THEN DO
- 'PRINTDOCUMENT PAGE "" OUTPUT '|| output.prm ||' SCALE "FULLPAGE"'
- END
-
- Call BusyText(2, "%c%bdeleting page%n\n%c...%n")
- Call BusyProgress(2, 50)
- 'SELECTOBJECT ALL WINDOW "'oldwinname'"'
- 'DELETEOBJECT WINDOW "'oldwinname'"'
- RETURN
- /* /// */
- /* /// RekDir(dir)
- */
- RekDir:
- PROCEDURE EXPOSE prefs. const. oldfilepath oldwinname wpw wph pNum anzp pagesizex pagesizey psf0 psx0 psy0 psy0nt psf1 psx1 psy1 BusyReq defmeasure pcversion startx starty lastpic pageNumber nppp maxheight maxwidth
-
- PARSE ARG dir
-
- Call BusyText(2, "%c%bscanning...%n\n%c"|| dir ||"%n")
- Call BusyProgress(2, 100)
-
- /*
- * list all files in directory into a buffer file
- */
-
- say dir prefs.PV_filePattern
- ADDRESS COMMAND 'C:list DIR "'||dir||'" PAT "'prefs.PV_filePattern'" LFORMAT="%F%N" FILES >T:PicCatalogFilesUS.tmp'
-
- /*
- * sort the buffer file (if entries exist)
- */
-
- IF (GetLength('T:PicCatalogFilesUS.tmp') = 0)
- THEN ADDRESS COMMAND 'C:Copy T:PicCatalogFilesUS.tmp TO T:PicCatalogFilesS.tmp'
- ELSE DO
- ADDRESS COMMAND 'C:Sort FROM T:PicCatalogFilesUS.tmp TO T:PicCatalogFilesS.tmp'
- Call WorkFileList
- END
-
- ADDRESS COMMAND 'C:Delete >NIL: T:PicCatalogFilesUS.tmp T:PicCatalogFilesS.tmp QUIET'
-
- /*
- * if recursive mode is on, list subdirectories
- */
-
- IF (prefs.PV_rec = 1)
- THEN DO
-
- /*
- * list subdirs into buffer and sort them
- */
-
- ADDRESS COMMAND 'C:List DIR "'|| dir ||'" PAT "'prefs.PV_dirPattern'" LFORMAT="%F%N" DIRS >T:PicCatalogDirsUS.tmp'
-
- IF (GetLength('T:PicCatalogDirsUS.tmp') = 0)
- THEN ADDRESS COMMAND 'C:Copy T:PicCatalogDirsUS.tmp TO T:PicCatalogDirsS.tmp'
- ELSE DO
-
- /*
- * if at least one entry is in buffer, work this directory
- */
-
- ADDRESS COMMAND 'C:Sort FROM T:PicCatalogDirsUS.tmp TO T:PicCatalogDirsS.tmp'
- Call WorkDirList
- END
-
- /*
- * delete remaining buffer directory file
- */
-
- ADDRESS COMMAND 'C:Delete >NIL: T:PicCatalogDirsUS.tmp T:PicCatalogDirsS.tmp QUIET'
-
- END
- RETURN 0
- /* /// */
- /* /// ReplaceItemInText(src, item, new)
- */
- ReplaceItemInText:
- PARSE ARG src,item,new
-
- /*
- ** prepare the thumbnail text
- */
-
- dest = src
- pos = Index(dest, item)
- IF (pos > 0)
- THEN DO
- dest = DelStr(dest, pos, Length(item))
- dest = Insert(new, dest, pos-1)
- END
- Return dest
- /* /// */
- /* /// SaveDocument()
- */
- SaveDocument:
- Call BusyText(2, "%c%bsaving document%n\n%c"|| prefs.PV_sDir ||"%n")
- Call BusyProgress(2, 100)
-
- Call DumpText('----- saving document: "'prefs.PV_sDir'" -----')
- 'SAVEDOCUMENT FILE "'prefs.PV_sDir'" FILTER IFFDOC STATUS FORCE'
- RETURN
- /* /// */
- /* /// SavePrefs(fileName)
- */
- SavePrefs:
- /*
- ** save the preferences file
- ** -------------------------
- */
-
- PARSE ARG filename
- IF (fileName = "")
- THEN fileName = standardPrefs
-
- say 'saving 'fileName' ...'
-
- okOpen = Open('Prefs', fileName, 'W')
- IF (okOpen = 1)
- THEN DO
- OPTIONS FAILAT 11
- Say 'writing prefs "'|| fileName ||'"...'
- WriteLN('Prefs', pgsName pgsVersion)
-
- Call WritePrefsNameValue('Prefs', 'prefs.PV_top')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_left')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_bottom')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_right')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_pbw')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_lsize')
-
- Call WritePrefsNameValue('Prefs', 'prefs.PV_size')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_x_num')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_y_num')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_x_size')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_y_size')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_upscale')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_vertical')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_fpo')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_fpoCustom')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_sbw')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_thumbSpace')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_gap')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_font')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_thumbText')
-
- Call WritePrefsNameValue('Prefs', 'prefs.PV_dir')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_rec')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_dirPattern')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_filePattern')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_dump')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_skip')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_sdir')
-
- Call WritePrefsNameValue('Prefs', 'prefs.PV_method')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_scale')
-
- Call WritePrefsNameValue('Prefs', 'prefs.PV_action')
- Call WritePrefsNameValue('Prefs', 'prefs.PV_formats')
-
- WriteLN('Prefs', '/* END OF Prefsfile for '|| pgsName pgsVersion ||' ('|| pgsDate ||') */')
- OPTIONS FAILAT 10
- Call Close('Prefs')
- END
- ELSE DO
- Say 'Error writing prefs file "'|| fileName ||'"'
- Call ShowRequester('ERROR writing prefs file '|| fileName, 'Damn!')
- END
- RETURN
- /* /// */
- /* /// SavePrefsAs()
- */
- SavePrefsAs:
- /*
- ** Save Prefs with selectable name
- ** -------------------------------
- */
-
- prefName = GetFileName(currentPrefs, 'Save Preferences As...')
- IF (prefName ~= 0)
- THEN DO
- currentPrefs = prefName
- Call SavePrefs(currentPrefs)
- END
- Return
- /* /// */
- /* /// SetCorrectMSys(vName)
- */
- SetCorrectMSys:
- PARSE ARG vName
-
- Interpret vName || ' = p2d('|| vName || ', mSys('|| vName ||')) || mSys('|| vName ||')'
- Return
- /* /// */
- /* /// SetDefaultPrefs()
- */
- SetDefaultPrefs:
-
- /*
- ** defaults needed in the program
- */
-
- Progress = 0
- currentPrefs = standardPrefs
- const.measure = 'pt'
- const.tf.0 = 'FALSE'
- const.tf.1 = 'TRUE'
- const.formats = 'UNIVERSAL ARTEXPRESSIONEPS BMP EPS FREEHANDEPS GIF IFFDR2D IFFILBM IFFILUS ILLUSTRATOREPS JPEG PCX PICT TIFF PAGESTREAM3DOC PRODRAWCLIP'
- const.fpo.0 = 'DEFAULT'
- const.fpo.1 = 'FINE'
- const.fpo.2 = 'MEDIUM'
- const.fpo.3 = 'COARSE'
- const.fpo.4 = 'CUSTOM'
-
- prefs.PV_left = '1cm' /* page left */
- prefs.PV_right = '1cm' /* page top */
- prefs.PV_top = '1cm' /* page top */
- prefs.PV_bottom = '1cm' /* page bottom */
- prefs.PV_pbw = '3pt' /* page border width */
- prefs.PV_lsize = '12pt' /* page text size */
-
- prefs.PV_x_num = '4' /* number of thumbnails X */
- prefs.PV_y_num = '6' /* number of thumbnails Y */
- prefs.PV_x_size = '200pt' /* size of one thumbnail X */
- prefs.PV_y_size = '200pt' /* size of one thumbnail Y */
- prefs.PV_upscale = '0' /* do not upscale pics */
- prefs.PV_vertical = '0' /* no vertical mode */
- prefs.PV_fpo = '0' /* FPU = DEFAULT */
- prefs.PV_fpoCustom = '50' /* FPO Custom = 50dpi */
- prefs.PV_thumbSpace = '2pt' /* Thumbnail space */
- prefs.PV_gap = '5mm' /* gap between pictures */
- prefs.PV_sbw = '2pt' /* sample border width */
- prefs.PV_font = '8pt' /* font size for thumbnails */
- prefs.PV_size = '8pt' /* size for the picnames */
- prefs.PV_thumbText = ConvertText2hex("%PICTURENAME\n[%TYPE - %SCALE]") /* thumbnail text... */
-
- prefs.PV_dir = 'Ram:' /* picture path */
- prefs.PV_rec = '0' /* recursive */
- prefs.PV_dirPattern = '#?' /* directory pattern */
- prefs.PV_filePattern = '#?' /* file pattern */
- prefs.PV_sdir = 'Ram:test.doc' /* file for saving */
- prefs.PV_dump = pgsInstallDir || '/' /* dump file path */
- prefs.PV_skip = '0' /* use skip file */
-
- prefs.PV_scale = '0' /* print: scale to fit */
- prefs.PV_method = '0' /* print: bw/color */
-
- prefs.PV_action = '0' /* action (collect, save, print) */
- prefs.PV_formats = 'UNIVERSAL IFFILBM' /* active formats */
-
- prefs.errorSkip = 0
- Return
- /* /// */
- /* /// ShowRequester(question, knobs)
- */
- ShowRequester:
- /*
- ** Show requester with some gadgets
- ** --------------------------------
- */
- PARSE ARG question,knobs
- Say question
- reqData = EasyRequest(question, pgsNAme, knobs)
- say reqData
- Return reqData
- /* /// */
- /* /// SizeError()
- */
- SizeError:
- res = ShowRequester("Current picture is too big","skip|skip all|stop")
- IF (res = 0)
- THEN DO
- Call CLEANUP
- Exit
- END
- Return res
- /* /// */
- /* /// WorkFileList()
- */
- WorkFileList:
- PROCEDURE EXPOSE prefs. const. oldfilepath oldwinname wpw wph pNum anzp pagesizex pagesizey psf0 psx0 psy0 psy0nt psf1 psx1 psy1 BusyReq defmeasure pcversion startx starty lastpic pageNumber nppp maxheight maxwidth
-
- fNum = 0
- IF (Open('flist','t:PicCatalogFilesS.tmp','R') ~= 1)
- THEN DO
- SAY 'Error when opening the File-TmpFiles!!!'
- EXIT
- END
-
- DO WHILE (eof('flist') = 0)
- named = readln('flist')
- IF (eof('flist') = 0)
- THEN DO
- name.fNum = named
- fNum = fNum + 1
- END
- END
- cl = Close('flist')
-
- DO k = 0 TO fNum-1
- IF (prefs.PV_skip = 1)
- THEN DO
- commands = 'C:Search >NIL: "'prefs.PV_dump'PicCatalog.dumpfileOLD" SEARCH "'name.k'"'
- ADDRESS COMMAND commands
- rcer = rc
- IF (rcer>0) THEN Call AddPicture(name.k)
- ELSE Call DumpText('('||pNum||') '||name.k||' -> SKIPPED')
- END
- ELSE CALL AddPicture(name.k)
- END
- RETURN
- /* /// */
- /* /// WorkDirList()
- */
- WorkDirList:
- PROCEDURE EXPOSE prefs. const. oldfilepath oldwinname wpw wph pNum anzp pagesizex pagesizey psf0 psx0 psy0 psy0nt psf1 psx1 psy1 BusyReq defmeasure pcversion startx starty lastpic pageNumber nppp maxheight maxwidth
-
- ad = 0
- IF (Open('dlist', 't:PicCatalogDirsS.tmp', 'R') ~= 1)
- THEN DO
- SAY 'Error while opening the DIR-TmpFiles!!!'
- EXIT
- END
-
- DO WHILE (eof('dlist') = 0)
- name = readln('dlist')
- IF (eof('dlist') = 0)
- THEN DO
- dirname.ad = name
- ad = ad + 1
- END
- END
- cl = Close('dlist')
-
- ADDRESS COMMAND 'C:Delete >NIL: T:PicCatalogDirsUS.tmp T:PicCatalogDirsS.tmp QUIET'
-
- DO k = 0 TO (ad - 1)
- Call RekDir(dirname.k)
- END
- Return
- /* /// */
- /* /// WritePrefsNameValue(file, name)
- */
- WritePrefsNameValue:
- /*
- ** write parameter with value in file
- ** ----------------------------------
- */
-
- PARSE ARG file,name
-
- Interpret "saveSTR = '"|| name ||" = ""'"|| name ||"'""'"
- WriteLN(file, saveSTR)
- Return
- /* /// */
-
- /* /// ON SYNTAX
- */
- SYNTAX:
- f = rc
- str = "*-------------------------------------------*"
- str = str || '|' || "* Syntax Error in line "|| sigl
- str = str || '|' || "* "|| f ||":" ErrorText(f)
- str = str || '|' || "*-------------------------------------------*"
-
- /*
- ** Unlock PageStream and QUIT
- */
- ADDRESS 'PAGESTREAM'
- 'LOCKINTERFACE FALSE'
- 'REFRESH ON'
- 'REFRESHWINDOW WINDOW "'|| oldWinName ||'"'
- ''defmeasure''
-
- Call pgsRequester(str)
-
- IF (f = 15)
- THEN DO
- Call pgsRequester('You should consider to register rxMUI.|Looks like the trial time is over.')
- END
-
- EXIT
- /* /// */
-
-